# (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
METRIC_MAP = [
    {
        # agency metrics
        'arangodb_agency_cache_callback_number': {'name': 'agency.cache.callback'},
        'arangodb_agency_callback_number': {'name': 'agency.callback'},
        'arangodb_agency_callback_registered': {'name': 'agency.callback.registered'},
        'arangodb_agency_client_lookup_table_size': {'name': 'agency.client.lookup.table_size'},
        'arangodb_agency_commit_hist': {'name': 'agency.commit'},
        'arangodb_agency_compaction_hist': {'name': 'agency.compaction'},
        'arangodb_agency_log_size_bytes': {'name': 'agency.log.size'},
        'arangodb_agency_read_no_leader': {'name': 'agency.read.no_leader'},
        'arangodb_agency_read_ok': {'name': 'agency.read.ok'},
        'arangodb_agency_supervision_failed_server': {'name': 'agency.supervision.failed.server'},
        'arangodb_agency_write_hist': {'name': 'agency.write'},
        'arangodb_agency_write_no_leader': {'name': 'agency.write.no_leader'},
        'arangodb_agency_write_ok': {'name': 'agency.write.ok'},
        'arangodb_agencycomm_request_time_msec': {'name': 'agency.request.time'},
        # network
        'arangodb_network_forwarded_requests': {'name': 'network.forwarded.requests'},
        'arangodb_network_request_timeouts': {'name': 'network.request.timeouts'},
        'arangodb_network_requests_in_flight': {'name': 'network.requests.in.flight'},
        # aql
        'arangodb_aql_all_query': {'name': 'aql.all.query'},
        'arangodb_aql_current_query': {'name': 'aql.current.query'},
        'arangodb_aql_global_memory_limit': {'name': 'aql.global.memory.limit'},
        'arangodb_aql_global_memory_usage': {'name': 'aql.global.memory.usage'},
        'arangodb_aql_global_query_memory_limit_reached': {'name': 'aql.global.query.memory.limit.reached'},
        'arangodb_aql_local_query_memory_limit_reached': {'name': 'aql.local.query.memory.limit.reached'},
        'arangodb_aql_query_time': {'name': 'aql.query.time'},
        'arangodb_aql_slow_query_time': {'name': 'aql.slow.query.time'},
        # client connection
        'arangodb_client_connection_statistics_bytes_received': {'name': 'client.connection.bytes.received'},
        'arangodb_client_connection_statistics_client_connections': {'name': 'client.connections'},
        'arangodb_client_connection_statistics_connection_time': {'name': 'client.connection.time'},
        'arangodb_client_connection_statistics_io_time': {'name': 'client.connection.io.time'},
        'arangodb_client_connection_statistics_queue_time': {'name': 'client.connection.queue.time'},
        'arangodb_client_connection_statistics_request_time': {'name': 'client.connection.request.time'},
        'arangodb_client_connection_statistics_total_time': {'name': 'client.connection.total.time'},
        # http
        'arangodb_http_request_statistics_async_requests': {'name': 'http.async.requests'},
        'arangodb_http_request_statistics_http_delete_requests': {'name': 'http.delete.requests'},
        'arangodb_http_request_statistics_http_get_requests': {'name': 'http.get.requests'},
        'arangodb_http_request_statistics_http_head_requests': {'name': 'http.head.requests'},
        'arangodb_http_request_statistics_http_options_requests': {'name': 'http.options.requests'},
        'arangodb_http_request_statistics_http_patch_requests': {'name': 'http.patch.requests'},
        'arangodb_http_request_statistics_http_post_requests': {'name': 'http.post.requests'},
        'arangodb_http_request_statistics_http_put_requests': {'name': 'http.put.requests'},
        'arangodb_http_request_statistics_other_http_requests': {'name': 'http.other.requests'},
        'arangodb_http_request_statistics_total_requests': {'name': 'http.total.requests'},
        'arangodb_http_request_statistics_user_requests': {'name': 'http.user.requests'},
        # process
        'arangodb_process_statistics_major_page_faults': {'name': 'process.page.faults.major'},
        'arangodb_process_statistics_minor_page_faults': {'name': 'process.page.faults.minor'},
        'arangodb_process_statistics_number_of_threads': {'name': 'process.threads'},
        'arangodb_process_statistics_resident_set_size': {'name': 'process.resident_set_size'},
        'arangodb_process_statistics_system_time': {'name': 'process.system_time'},
        'arangodb_process_statistics_user_time': {'name': 'process.user_time'},
        'arangodb_process_statistics_virtual_memory_size': {'name': 'process.virtual_memory_size'},
        # server stat
        'arangodb_server_statistics_cpu_cores': {'name': 'server.cpu_cores'},
        'arangodb_server_statistics_idle_percent': {'name': 'server.idle_percent'},
        'arangodb_server_statistics_iowait_percent': {'name': 'server.iowait_percent'},
        'arangodb_server_statistics_physical_memory': {'name': 'server.physical_memory'},
        'arangodb_server_statistics_system_percent': {'name': 'server.kernel_mode.percent'},
        'arangodb_server_statistics_user_percent': {'name': 'server.user_mode.percent'},
        # collection
        'arangodb_collection_lock_acquisition_micros': {'name': 'collection.lock.acquisition'},
        'arangodb_collection_lock_sequential_mode': {'name': 'collection.lock.sequential_mode'},
        'arangodb_collection_lock_timeouts_exclusive': {'name': 'collection.lock.timeouts_exclusive'},
        'arangodb_collection_lock_timeouts_write': {'name': 'collection.lock.timeouts_write'},
        # transaction
        'arangodb_read_transactions': {'name': 'transactions.read'},
        'arangodb_transactions_aborted': {'name': 'transactions.aborted'},
        'arangodb_transactions_committed': {'name': 'transactions.committed'},
        'arangodb_transactions_expired': {'name': 'transactions.expired'},
        'arangodb_transactions_started': {'name': 'transactions.started'},
        # rocksDB
        'arangodb_collection_lock_acquisition_time': {'name': 'rocksdb.collection_lock.acquisition_time'},
        'arangodb_rocksdb_write_stalls': {'name': 'rocksdb.write.stalls'},
        'arangodb_rocksdb_write_stops': {'name': 'rocksdb.write.stops'},
        'rocksdb_actual_delayed_write_rate': {'name': 'rocksdb.actual.delayed.write.rate'},
        'rocksdb_archived_wal_files': {'name': 'rocksdb.archived.wal.files'},
        'rocksdb_background_errors': {'name': 'rocksdb.background.errors'},
        'rocksdb_base_level': {'name': 'rocksdb.base.level'},
        'rocksdb_block_cache_capacity': {'name': 'rocksdb.block.cache.capacity'},
        'rocksdb_block_cache_pinned_usage': {'name': 'rocksdb.block.cache.pinned.usage'},
        'rocksdb_block_cache_usage': {'name': 'rocksdb.block.cache.usage'},
        'rocksdb_cache_hit_rate_lifetime': {'name': 'rocksdb.cache.hit.rate.lifetime'},
        'rocksdb_cache_limit': {'name': 'rocksdb.cache.limit'},
        'rocksdb_compaction_pending': {'name': 'rocksdb.compaction.pending'},
        'rocksdb_cur_size_active_mem_table': {'name': 'rocksdb.cur.size.active.mem.table'},
        'rocksdb_cur_size_all_mem_tables': {'name': 'rocksdb.cur.size.all.mem.tables'},
        'rocksdb_engine_throttle_bps': {'name': 'rocksdb.engine.throttle.bps'},
        'rocksdb_estimate_live_data_size': {'name': 'rocksdb.estimate.live.data.size'},
        'rocksdb_estimate_num_keys': {'name': 'rocksdb.estimate.num.keys'},
        'rocksdb_estimate_pending_compaction_bytes': {'name': 'rocksdb.estimate.pending.compaction.bytes'},
        'rocksdb_estimate_table_readers_mem': {'name': 'rocksdb.estimate.table.readers.mem'},
        'rocksdb_free_disk_space': {'name': 'rocksdb.free.disk.space'},
        'rocksdb_free_inodes': {'name': 'rocksdb.free.inodes'},
        'rocksdb_live_sst_files_size': {'name': 'rocksdb.live.sst.files.size'},
        'rocksdb_mem_table_flush_pending': {'name': 'rocksdb.mem.table.flush.pending'},
        'rocksdb_min_log_number_to_keep': {'name': 'rocksdb.min.log.number.to.keep'},
        'rocksdb_num_deletes_active_mem_table': {'name': 'rocksdb.num.deletes.active.mem.table'},
        'rocksdb_num_deletes_imm_mem_tables': {'name': 'rocksdb.num.deletes.imm.mem.tables'},
        'rocksdb_num_entries_active_mem_table': {'name': 'rocksdb.num.entries.active.mem.table'},
        'rocksdb_num_entries_imm_mem_tables': {'name': 'rocksdb.num.entries.imm_mem.tables'},
        'rocksdb_num_immutable_mem_table': {'name': 'rocksdb.num.immutable.mem.table'},
        'rocksdb_num_immutable_mem_table_flushed': {'name': 'rocksdb.num.immutable.mem.table.flushed'},
        'rocksdb_num_live_versions': {'name': 'rocksdb.num.live.versions'},
        'rocksdb_num_running_compactions': {'name': 'rocksdb.num.running.compactions'},
        'rocksdb_num_running_flushes': {'name': 'rocksdb.num.running.flushes'},
        'rocksdb_num_snapshots': {'name': 'rocksdb.num.snapshots'},
        'rocksdb_prunable_wal_files': {'name': 'rocksdb.prunable.wal.files'},
        'rocksdb_size_all_mem_tables': {'name': 'rocksdb.size.all.mem.tables'},
        'rocksdb_total_disk_space': {'name': 'rocksdb.total.disk.space'},
        # health
        'arangodb_dropped_followers': {'name': 'health.dropped_followers'},
        'arangodb_heartbeat_failures': {'name': 'health.heartbeat_failures'},
        'arangodb_heartbeat_send_time_msec': {'name': 'health.heartbeat.sent.time'},
        # connectivity
        'arangodb_connection_pool_connections_created': {'name': 'connection_pool.connections.created'},
        'arangodb_connection_pool_connections_current': {'name': 'connection_pool.connections.current'},
        'arangodb_connection_pool_lease_time_hist': {'name': 'connection_pool.lease_time'},
        'arangodb_connection_pool_leases_failed': {'name': 'connection_pool.leases.failed'},
        'arangodb_connection_pool_leases_successful': {'name': 'connection_pool.leases.successful'},
        'arangodb_http2_connections': {'name': 'http2.connections'},
        'arangodb_vst_connections': {'name': 'vst.connections'},
    }
]
